package cn.edu.lingnan.part.dao;

import cn.edu.lingnan.part.Utils.MySqlProvider;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;

/**
 * @Author: chen_man_cheng
 * @Description: //TODO
 * @Date: Create in 21:04 2020/6/3
 */
public interface BaseDao<T> {
    /**
     * 新增数据
     *
     * @param systemMenu 实例对象
     * @return 影响行数
     */
    @InsertProvider(type = MySqlProvider.class, method = MySqlProvider.INSERT)
    int insert(T systemMenu);

    /**
     * 删除数据
     *
     * @param
     * @return 影响行数
     */
    @DeleteProvider(type = MySqlProvider.class, method = MySqlProvider.DELETE)
    int delete(@Param("table") String table, @Param("where") String where);

    /**
     * 删除数据
     *
     * @param systemMenu 实例对象
     * @return 影响行数
     */
//  @UpdateProvider(type = MySqlPrivider.class, method = MySqlPrivider.UPDATE)
//  int update(T systemMenu);
    @UpdateProvider(type = MySqlProvider.class, method = MySqlProvider.UPDATE)
    int update(T systemMenu);
}
